import request from "/@/utils/request"

export function fetchList(query?: Object) {
  return request({
    url: '/train/zsglCertificateTemplate/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj?: Object) {
  return request({
    url: '/train/zsglCertificateTemplate',
    method: 'post',
    data: obj
  })
}

export function getObj(id?: string) {
  return request({
    url: '/train/zsglCertificateTemplate/' + id,
    method: 'get'
  })
}

export function delObjs(ids?: Object) {
  return request({
    url: '/train/zsglCertificateTemplate',
    method: 'delete',
    data: ids
  })
}

export function putObj(obj?: Object) {
  return request({
    url: '/train/zsglCertificateTemplate',
    method: 'put',
    data: obj
  })
}

// 获取证书管理名称
export  function getcertificateName (id? :any) {
  return request({
    url : '/train/zsglCertificateTemplate/getZsglCertificateList',
    method : 'get'
  })
}

// 获取预览证书
export  function getCertificatePreview (code? :any) {
  return request({
    url : `/train/zsglCertificateQualifications/getCertificateDisplay/${code}`,
    method : 'get',
    responseType : 'arraybuffer'
  })
}


export function getCertificatePreview2 (id? :any) {
  return request({
    url: `/train/zsglCertificateQualifications/getCertificateExample/${id}`,
    method: 'get',
    responseType : 'arraybuffer'
  })
}

